import BaseModel from './BaseModel'
import API from '../../api/apis'

/**
 * 首页链接模型
 */
class HomeLinksModel extends BaseModel {
  // 构造方法
  constructor() {
    super()
    /**
     * 标题
     * @type {string}
     */
    this.title = ''
    /**
     * 链接
     * @type {string}
     */
    this.link = ''

    /**
     * ====================== URL 相关 ====================================
     */
    /**
     * 获取详情数据的URL
     * @type {String}
     */
    this.detailUrl = API.homeLink.detail
    /**
     * 删除数据的URL
     * @type {String}
     */
    this.removeUrl = API.homeLink.remove
    /**
     * 添加数据的URL
     * @type {String}
     */
    this.addUrl = API.homeLink.add
    /**
     * 更新数据的URL
     * @type {String}
     */
    this.updateUrl = API.homeLink.update
    /**
     * 添到回收站的URL
     * @type {String}
     */
    this.dustbinPushUrl = API.homeLink.dustbinPush
    /**
     * 回收站还原的URL
     * @type {String}
     */
    this.dustbinPopUrl = API.homeLink.dustbinPop
    /**
     * 添加修改数据的KEY数组
     * @type {Array}
     */
    this.addOrUpdateKeyArr = ['title', 'link']
  }
}

/**
 * 列表加载URL
 * @type {String}
 */
HomeLinksModel.listUrl = API.homeLink.all
/**
 * 获取所有回收站数据
 * @type {String}
 */
HomeLinksModel.dustbinAllUrl = API.homeLink.dustbinAll

export default HomeLinksModel
